package big.ketech.process.dataobject;

import big.ketech.utils.MyExcelExportUtil;
import cn.afterturn.easypoi.excel.annotation.Excel;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * t_student
 * @author 
 */
public class TStudent implements Serializable {
    /**
     * 学号
     */
    @Excel(name = "学号", width = 20, orderNum = "1")
    private String id;

    /**
     * 姓名
     */
    @Excel(name = "姓名", width = 20, orderNum = "2")
    private String name;

    /**
     * 性别(1:男 2:女)
     * replace:导出是{a_id,b_id} 导入反过来,注意大括号里面单独引号引起来的
     */
    @Excel(name = "性别", width = 20, replace = { "男_1", "女_2" },orderNum = "3")
    private String sex;

    /**
     * 年龄
     */

    @Excel(name = "年龄", width = 20, orderNum = "4")
    private Integer age;

    /**
     * 出生日期
     */
    private Date birthday;
    @Excel(name = "出生日期", width = 20, orderNum = "5")
    private String birthdayYMR;

    /**
     * 入学时间
     */

    private Date registDate;
    @Excel(name = "入学时间",width = 20,orderNum = "6")
    private String registDateYMR;
    /**
     * 学费
     */
    @Excel(name = "学费", width = 20, orderNum = "7")
    private BigDecimal fee;

    public String getBirthdayYMR() {
        if(getBirthday()!=null){
            birthdayYMR=MyExcelExportUtil.convertDateToYMR(getBirthday());
            return  birthdayYMR;
        }
        return "";
    }

    public String getRegistDateYMR() {
        if(getRegistDate()!=null){
            birthdayYMR=MyExcelExportUtil.convertDateToYMR(getRegistDate());
            return  birthdayYMR;
        }
        return "";
    }

    private static final long serialVersionUID = 1L;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public Date getRegistDate() {
        return registDate;
    }

    public void setRegistDate(Date registDate) {
        this.registDate = registDate;
    }

    public BigDecimal getFee() {
        return fee;
    }

    public void setFee(BigDecimal fee) {
        this.fee = fee;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TStudent other = (TStudent) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getSex() == null ? other.getSex() == null : this.getSex().equals(other.getSex()))
            && (this.getAge() == null ? other.getAge() == null : this.getAge().equals(other.getAge()))
            && (this.getBirthday() == null ? other.getBirthday() == null : this.getBirthday().equals(other.getBirthday()))
            && (this.getRegistDate() == null ? other.getRegistDate() == null : this.getRegistDate().equals(other.getRegistDate()))
            && (this.getFee() == null ? other.getFee() == null : this.getFee().equals(other.getFee()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getSex() == null) ? 0 : getSex().hashCode());
        result = prime * result + ((getAge() == null) ? 0 : getAge().hashCode());
        result = prime * result + ((getBirthday() == null) ? 0 : getBirthday().hashCode());
        result = prime * result + ((getRegistDate() == null) ? 0 : getRegistDate().hashCode());
        result = prime * result + ((getFee() == null) ? 0 : getFee().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", sex=").append(sex);
        sb.append(", age=").append(age);
        sb.append(", birthday=").append(birthday);
        sb.append(", registDate=").append(registDate);
        sb.append(", fee=").append(fee);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}